package ${model.packageName}.as.impl;

import com.dhc.framework.base.dao.IBaseDao;
import com.dhc.framework.base.exception.BaseASException;
import com.dhc.framework.base.service.impl.BaseAppServiceImpl;
import java.util.List;

import ${model.packageName}.as.${model.initUpperName}AS;
import ${model.packageName}.dao.${model.initUpperName}Dao;
import ${model.packageName}.domain.${model.initUpperName};

public class ${model.initUpperName}ASImpl extends BaseAppServiceImpl implements ${model.initUpperName}AS {
	/**
	 * 新增
	 */
	public String add(${model.initUpperName} model) throws BaseASException{
		return (String) ${model.initLowerName}Dao.insert(model);
	}
	/**
	 * 修改
	 */
	public void edit(${model.initUpperName} model) throws BaseASException{
		${model.initLowerName}Dao.update(model);
	}
	/**
	 * 删除
	 */
	public void delete(${model.initUpperName} model) throws BaseASException{
		${model.initLowerName}Dao.delete(model);
	}
	/**
	 * 根据ID查看
	 */
	public ${model.initUpperName} queryOne(${model.initUpperName} model) throws BaseASException{
		return (${model.initUpperName}) ${model.initLowerName}Dao.getObjectById(model.getId());
	}
	/**
	 * 查询符合条件的数据集合
	 */
	public List<${model.initUpperName}> queryList(${model.initUpperName} model) throws BaseASException{
		return ${model.initLowerName}Dao.query(model);
	}

	private ${model.initUpperName}Dao ${model.initLowerName}Dao;
	
	public ${model.initUpperName}Dao get${model.initUpperName}Dao() {
		return ${model.initLowerName}Dao;
	}

	public void set${model.initUpperName}Dao(${model.initUpperName}Dao ${model.initLowerName}Dao) {
		this.${model.initLowerName}Dao = ${model.initLowerName}Dao;
	}

	public IBaseDao<${model.initUpperName}> getDao() {
		return ${model.initLowerName}Dao;
	}
}
